package com.alisls.shequtao.service.goods.web;

import com.alisls.shequtao.service.goods.dto.SkuDTO;
import com.alisls.shequtao.service.goods.service.SkuService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Sku管理
 *
 * @author Ke Wang
 */
@RestController
@RequestMapping("/sku")
@AllArgsConstructor
public class SkuController {

    private final SkuService skuService;

    @GetMapping("/listSkusBySpuId/{spuId}")
    public List<SkuDTO> listSkusBySpuId(@PathVariable("spuId") Long spuId) {
        return skuService.listSkusBySpuId(spuId);
    }

}
